package com.hc.common.utils;

/**
 * string 工具类
 *
 * @author 六月Bing
 */
public class StringUtil {

    /**
     * 交叉将两个参数指定的字符串并返回
     *
     * @param content
     * @param salt
     * @return
     */
    public static String daSan(String content, String salt) {
        String res = "";
        int len = content.length() > salt.length() ? salt.length() : content.length();
        int i = 0;
        for (; i < len; i++) {
            res = res + content.charAt(i) + salt.charAt(i);
        }
        if (content.length() > salt.length()) {
            res += content.substring(i);
        } else {
            res += salt.substring(i);
        }
        return res;
    }

    public static void main(String[] args) {
        System.out.println(daSan("asdfghj", "123579"));
        System.out.println(daSan("asdf", "123579"));
    }
}